﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Macds.Test.Core.Web
{
    [TestClass]
    public class WebRequestBaseTest
    {
        [TestMethod]
        public void Get_remote_data_by_post_request()
        {
            // Create instance of the http request manager class
            var manager = new Mocks.HttpRequestManager();

            // Retreive data from google.com
            string data = manager.GetRemoteDataByPost("http://www.checkupdown.com/", "");

            // Validation
            Assert.IsFalse(String.IsNullOrEmpty(data));
            Assert.IsTrue(data.Length > 200);
        }

        [TestMethod]
        public void Get_remote_data_by_get_request()
        {
            // Create instance of the http request manager class
            var manager = new Mocks.HttpRequestManager();

            // Retreive data from google.com
            string data = manager.GetRemoteDataByGet("http://www.google.com", "");

            // Validation
            Assert.IsFalse(String.IsNullOrEmpty(data));
            Assert.IsTrue(data.Length > 200);
        }
    }
}
